<?php

class GoController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        $itemId=$this->getRequest()->getParam("itemId");
        $shopId=$this->getRequest()->getParam("shopId");
        //商品id
        if(null!=$itemId){
            $dbTaoBaoItems=new Application_Model_DbTable_TaobaoItems();
            $res=$dbTaoBaoItems->getItemsByNumiid($itemId);
            if(null!=res){
                $this->_redirect($res['click_url']);
            }
        }
        //店铺id
        if(null!=$shopId){
            $dbTaoBaoItems=new Application_Model_DbTable_TaobaoItems();
            $res=$dbTaoBaoItems->getItemsByNumiid($shopId);
            if(null!=res){
                $this->_redirect($res['shop_click_url']);
            }
        }
        $this->_redirect("http://www.taoxiuyu.cn");
    }


}

